<template>
  <div id="contain">
    <div>
      <el-table
        :data="tableList"
        style="width: 945px"
        stripe
        :row-style="rowStyle"
        :cell-style="cellStyle"
      >
        <el-table-column prop="name" label="攻略标题" align="center">
        </el-table-column>
        <el-table-column prop="phone" label="发布者账号" align="center">
        </el-table-column>
        <el-table-column prop="status" label="状态" align="center">
        </el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <el-button size="mini" type="primary" @click="pass(scope.row)"
              >通过申请</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="block">
      <el-pagination
        :current-page.sync="page"
        :page-sizes="[10, 20]"
        :page-size="limit"
        layout="sizes, prev, pager, next"
        :total="totalCount"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      token: window.localStorage.getItem("token"),
      tableList: [
        { name: "四川旅游攻略", status: "未审核", phone: "15456567788" },
        { name: "西藏旅游攻略", status: "未审核", phone: "15456567788" },
      ],
      page: 1,
      limit: 20,
      totalCount: 0,
    };
  },
  methods: {
    rowStyle() {
      return { height: "60px" };
    },
    cellStyle(k) {
      if (k.columnIndex === 2) {
        if (k.row.status === "审核通过") {
          return { color: "#33CC00" };
        } else if (k.row.status === "未审核") {
          return { color: "blue" };
        } else {
          return { color: "red" };
        }
      }
    },
    pass() {},
  },
};
</script>
<style  scoped>
</style>>